package com.old.service;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.old.dto.ActivityDTO;
import com.old.dto.ActivityQueryDTO;
import com.old.dto.ActivityUpdateDTO;
import com.old.result.PageBean;
import com.old.result.Result;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ActivityService {

    /**
     * 添加活动信息
     * @param activityDTO
     */
    void addActivity(ActivityDTO activityDTO);

    /**
     * 查询活动列表
     * @param activityQueryDTO
     * @return
     */
    PageBean activityListPage(ActivityQueryDTO activityQueryDTO);

    @Transactional
    Result<String> cancelSignUp(Integer activityId, Integer userId);

    @Transactional
    Result<String> joinActivity(Integer activityId, Integer userId);


    @Transactional
    void updateActivityInfo( ActivityUpdateDTO activityUpdateDTO);

    @Transactional
    void deleteActivity(Integer activityId);

    PageBean pageList(Integer pageNo, Integer pageSize, Integer sortBy, String searchTerms, Integer userId) throws JsonProcessingException;

    //用户参加的活动列表
    PageBean userJoinActivityListPage(ActivityQueryDTO activityQueryDTO);

    void deleteActivitiesByIds(List<Integer> ids);
}
